home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / bildschirmschoner / swazblanker / programmer / include / libraries / matrix.h next >
C/C++ Source or Header  |  1996-04-07  |  14KB  |  467 lines

  1. #ifndef LIBRARIES_MXBASE_H
  2. #define LIBRARIES_MXBASE_H
  3. /*
  4. **    $VER: matrix.h 24.0 (19.05.95)
  5. **    Includes Release 40.5
  6. **
  7. **    Matrix definitions
  8. **
  9. **    (C) Copyright 1990-95 David Swasbrook
  10. **        All Rights Reserved
  11. */
  12.  
  13. /*****************************************************************************/
  14.  
  15. #ifndef EXEC_LIBRARIES_H
  16. #include <exec/libraries.h>
  17. #endif
  18.  
  19. #ifndef UTILITY_TAGITEM_H
  20. #include <utility/tagitem.h>
  21. #endif
  22.  
  23.  
  24.  
  25. /*****************************************************************************/
  26.  
  27. #define MATRIXNAME    "matrix.library"
  28. #define MX_TagBase    TAG_USER+0x80000
  29.  
  30. /*****************************************************************************/
  31.  
  32. struct MatrixBase {
  33.     struct    Library  LibNode;
  34.     /*** PRIVATE FIELDS FOLLOW ***/
  35.     APTR    SysLib;
  36.     APTR    SegList;
  37.     APTR    DOSBase;
  38. };
  39.  
  40.  
  41. struct MatrixAslInfo {
  42.     WORD    mxai_LeftEdge;
  43.     WORD    mxai_TopEdge;
  44.     WORD    mxai_Width;
  45.     WORD    mxai_Height;
  46.     WORD    mxai_expansion;
  47. };
  48.  
  49. /**********************************************************************
  50.  */
  51. struct WindowHandler {
  52.     UBYTE    wh_Active;    /* Cler to close and exit */
  53.     UBYTE    wh_SigBit;
  54.     struct Window *wh_Window;    /* Pointer to the window */
  55.     struct MsgPort *wh_UserPort;    /* UserOrt of window */
  56.     APTR    wh_MenuStrip;
  57.     UWORD    wh_Exp;
  58.     APTR    wh_fs;
  59.     APTR    wh_gv;
  60.     APTR    wh_mv;
  61.     APTR    wh_tl;
  62.     ULONG    wh_ReturnVal;    /* Writeable, value returned in d1 on exit */
  63.     ULONG    wh_UserData;    /* User */
  64.     APTR    wh_VisualInfo;
  65.     struct List *wh_BevBoxList;
  66.     APTR    wh_RemakeWindow;
  67.     UBYTE    wh_Flags;
  68.     UBYTE    wh_FlagsPad[2];
  69.     UBYTE    wh_LViewBarWidth;    /* Defaults to 16 */
  70.     struct TextAttr *wh_GadgetFont;
  71.     struct Locale *wh_Locale;
  72.     struct Catalog *wh_Catalog;    /* struct catalog * */
  73.     ULONG    *wh_CatCompArray;    /* (*ULONG) (*/
  74.     struct Catalog *wh_MxCatalog;     /* struct catalog * */
  75.     APTR    wh_ASLInfo;
  76.     struct Gadget *wh_ControlListView;
  77.     /* Private fields follow */
  78.     struct Font *wh_MXFont;
  79.     struct TextAttr wh_MXTextAttr;
  80.     struct MatrixAslInfo wh_ASLInfoStruct;
  81.  
  82. };
  83. /* do not make any assumptions on the size of this structure for it will
  84.    surely change as modifications are made, where possible every effort is
  85.    made to maintain the current settings.
  86.  */
  87.  
  88.  
  89.  
  90. /*****************************************************************************/
  91. /* CONSTANTS for MX_GetCatalogStr() */
  92. #define MXCC_PACKEDLIST    -1
  93. #define MXCC_OFFSETLIST    -2
  94.  
  95.     struct MxBoxGad {
  96.         struct Node Node;
  97.         APTR    Hook;    /* Private */
  98.         WORD    X;
  99.         WORD    Y;
  100.         WORD    Width;
  101.         WORD    Height;
  102.     };
  103.  
  104. #define MX_BUTTON       0x0001
  105. #define MX_CHECKBOX     0x0005
  106. #define MX_TEXT         0x0008
  107. #define MX_TEXTBOX      0x0009
  108. #define MX_FONT         0x0014
  109. #define MX_SCREENBUTTON 0x0016
  110. #define MX_HOOKCYCLE    0x0023
  111. #define MX_STRGAD       0x0040
  112. #define MX_NUMBER       0x0100
  113. #define MX_LISTVIEW     0x0111
  114. #define MX_SLIDER       0x0151
  115. #define MX_FILEBUTTON   0x0170
  116. #define MX_TABGAD       0x0300
  117.  
  118. #define MX_BOX          0x8020
  119. /* #define MX_BOX          0x8021 - this is the CSL BOX - yukky */
  120. #define MX_HORIZLINE    0x8022
  121. #define MX_GADPTR       0x8100
  122. #define MX_BOXPTR       0x8104
  123. #define MX_DISABLE      0x8120
  124. #define MX_LOCALIZE     0x8125
  125. #define MX_DOWNHALF     0x8128
  126. #define MX_SETKEYHOOK   0x8129    /* changes last hot key to a Hook( WH )( A0 ) */
  127.  
  128.  
  129. #define ID_IGNORE     0
  130. #define ID_BYTE       1
  131. #define ID_WORD       2
  132. #define ID_LONG       4
  133.  
  134. #define ID_HOOK       10
  135.  
  136. #define ID_CHK        20      /* See tags for extension fields */
  137. #define ID_STR        52
  138. #define ID_BUT        55
  139. #define ID_TXT        57
  140. #define ID_SCREEN     63
  141. #define ID_FONT       65
  142. #define ID_VBUT       155    /* UserData = Return code for window handler */
  143. #define ID_LVIEW      162
  144. #define ID_TABGAD     300
  145. #define ID_SLIDER     401
  146. #define ID_FILEBUTTON 420
  147. #define ID_HOOKCYCLE  1011
  148.  
  149.  
  150.  
  151. #define KEY_IGNORE    0
  152. #define KEY_GADGETUP  1
  153. #define KEY_ACTIVATE  2
  154. #define KEY_CHECKBOX  3
  155. #define KEY_SLIDER    5
  156. #define KEY_HOOK      6    /* Hook( WH )( A0 ) */
  157.  
  158.  
  159.  
  160. /*****************************************************************************/
  161. /* TAGS FOR MX_CHECKBOX type gadgets */
  162. /* #define MXCBT_Hook         MX_TagBase+0xA100 Obsolete, see MXCBT_CallBackHook */
  163. #define MXCBT_Shrink          MX_TagBase+0xA101    /* Gadget width and height will be reduced, set to ~0 */
  164. #define MXCBT_CallBackHook    MX_TagBase+0xA102   /* void Hook(Hook,Gadget,WindowHandler) */
  165.  
  166. /*****************************************************************************/
  167. /* TAGS FOR MX_GetScreenNameTagList() */
  168.  
  169. #define MXSN_Flags            MX_TagBase+0xA200   /* */
  170. #define MXSN_Labels           MX_TagBase+0xA201   /* */
  171.  
  172. /*****************************************************************************/
  173. /* TAGS FOR MX_GetFont() and MX_FreeFont() */
  174.  
  175. #define MXGF_FontName    MX_TagBase+0xF001
  176. #define MXGF_FontSize    MX_TagBase+0xF002
  177. #define MXGF_UseScreenFont    MX_TagBase+0xF003
  178. #define MXGF_FontSizeStr    MX_TagBase+0xF004
  179. #define MXGF_FontStyle    MX_TagBase+0xF005
  180.  
  181. /*****************************************************************************/
  182. /* TAGS FOR MX_AddVBlankNode() and MX_RemVBlankNode() */
  183.  
  184. #define MXVB_HookAddress    MX_TagBase+0xF101
  185. #define MXVB_UserData    MX_TagBase+0xF102
  186. #define MXVB_SigBit        MX_TagBase+0xF103
  187. #define MXVB_Count        MX_TagBase+0xF104
  188.  
  189. /*****************************************************************************/
  190.  
  191.  
  192. struct MXScreenMode {
  193.     ULONG    DisplayID;
  194.     ULONG    Width;
  195.     ULONG    Height;
  196.     UWORD    Depth;
  197. };
  198.  
  199. struct MxScreenMode {
  200.     ULONG    mxsm_displayid;
  201.     ULONG    mxsm_width;
  202.     ULONG    mxsm_height;
  203.     UWORD    mxsm_depth;
  204. };
  205.  
  206. #define mxsbB_FixedDimensions    0
  207. #define mxsbF_FixedDimensions    1<<mxsbB_FixedDimensions
  208. #define mxsbB_FixedDepth         1
  209. #define mxsbF_FixedDepth         1<<mxsbB_FixedDepth
  210.  
  211. #define    MXSBF_FIXEDDIMENSIONS  1<<0
  212. #define    MXSBF_FIXEDDEPTH       1<<1
  213. #define    MXSBF_STRINGPOINTER    1<<7
  214.  
  215.  
  216.  
  217. /*****************************************************************************/
  218. /* Tags for SCREEN type gadgets */
  219. #define MXSMR_AslTags         MX_TagBase+0xA000
  220. #define MXSMR_PlaceBox        MX_TagBase+0xA001
  221.     /* Placement for textbox, defualt = PLACETEXT_RIGHT
  222.        MSupported placetext modes: PLACETEXT_RIGHT, PLACETEXT_ABOVE ,PLACETEXT_BELOW
  223.      */
  224. #define MXSMR_Flags           MX_TagBase+0xA002
  225. #define MXSMR_NewDisplayModeHook MX_TagBase+0xA003
  226.     /*
  227.        struct Hook *, Hook( *Hook, *MxScreenMode, *WindowHandler)
  228.        This does not fit in with current conventions of Hook( Hook, Gadget, WindowHandler )
  229.      */
  230.  
  231.  
  232. /*****************************************************************************/
  233. /* TAGS FOR MX_AddVBlankNode() and MX_RemVBlankNode() */
  234. #define MXTFL_LineLength    MX_TagBase+0xF0B1
  235. #define MXTFL_NodeSize    MX_TagBase+0xF0B2
  236. #define MXTFL_SplitLines    MX_TagBase+0xF0B3
  237. #define MXTFL_FileHandle    MX_TagBase+0xF0B4
  238. #define MXTFL_SourceBuffer    MX_TagBase+0xF0B5
  239. #define MXTFL_LeadingSpaces    MX_TagBase+0xF0B6
  240. #define MXTFL_MemAttr    MX_TagBase+0xF0B7
  241. #define MXTFL_AllocateStrings    MX_TagBase+0xF0B8
  242. #define MXTFL_AllocateFullLine MX_TagBase+0xF0B9
  243. #define MXTFL_AllocateLNNAME    MX_TagBase+0xF0BA
  244. /*****************************************************************************/
  245.  
  246. /*****************************************************************************/
  247. /* TAGS FOR MX_NewSaveIFF(), MX_NewLoadIFF() (V23) */
  248. #define MXIF_Filename    MX_TagBase+0x2101
  249. #define MXIF_CreateDir    MX_TagBase+0x2102
  250. #define MXIF_Type         MX_TagBase+0x2103
  251. #define MXIF_HunkArray    MX_TagBase+0x2104
  252. #define MXIF_ValidateHook    MX_TagBase+0x2105
  253. #define MXIF_ANNO        MX_TagBase+0x2106
  254.  
  255. #define MXIF_Raw        0
  256. #define MXIF_HookMulti    MX_TagBase+0x2200
  257. #define MXIF_HookOwnchunk    MX_TagBase+0x2201
  258. #define MXIF_String        MX_TagBase+0x2202
  259.  
  260.  
  261.  
  262. /*****************************************************************************/
  263. /* TAGS FOR MX_NewPrefsWH (V23) */
  264. #define MXPF_WHTags        MX_TagBase+0x2000
  265. #define MXPF_DefaultHook    MX_TagBase+0x2001
  266. #define MXPF_ASLInfo    MX_TagBase+0x2002
  267. #define MXPF_LoadSaveDir    MX_TagBase+0x2003
  268. #define MXPF_Title        MX_TagBase+0x2004
  269. #define MXPF_LoadTitle    MX_TagBase+0x2005
  270. #define MXPF_SaveTitle    MX_TagBase+0x2006
  271. #define MXPF_Window        MX_TagBase+0x200a
  272. #define MXPF_Screen        MX_TagBase+0x200b
  273. #define MXPF_VisualInfo    MX_TagBase+0x200c
  274. #define MXPF_PubScreenName    MX_TagBase+0x200d
  275. #define MXPF_IFFTags    MX_TagBase+0x2010
  276. #define MXPF_SaveFile    MX_TagBase+0x2011
  277. #define MXPF_UseFile    MX_TagBase+0x2012
  278. #define MXPF_InitialLoad    MX_TagBase+0x2013
  279. #define MXPF_EnvName    MX_TagBase+0x2014
  280. #define MXPF_NewDataHook    MX_TagBase+0x2021
  281. #define MXPF_PreSaveHook      MX_TagBase+0x2022
  282. #define MXPF_PreLoadHook23    MX_TagBase+0x2023
  283. #define MXPF_TagMorePointer   MX_TagBase+0x202a
  284. #define MXPF_Font             MX_TagBase+0x2030
  285. #define MXPF_QuitMenuHook     MX_TagBase+0x2031
  286. #define MXPF_AboutMenuHook    MX_TagBase+0x2032
  287. #define MXPF_HelpMenuHook     MX_TagBase+0x2033
  288. #define MXPF_CallBack         MX_TagBase+0x2035
  289.  
  290. /*** Methods for MXPF_CallBack() ***/
  291. #define MXPFCB_LOAD           1
  292. #define MXPFCB_SAVE           2
  293. #define MXPFCB_DEFAULT    3
  294.  
  295. /*** Result codes for MXPF_CallBack() ***/
  296. #define MXPFCB_OK             0
  297. #define MXPFCB_UNKNOWN        ~0
  298.  
  299.  
  300.  
  301.  
  302. #define MXWINPOS_CENTER    0
  303. #define MXWINPOS_INPARENT    1
  304. #define MXWINPOS_CENTERPARENT    2
  305.  
  306. #define MXWH_Gadgets    MX_TagBase+0x01
  307. #define MXWH_Menus        MX_TagBase+0x02
  308. #define MXWH_Handler    MX_TagBase+0x03
  309. #define MXWH_Events        MX_TagBase+0x04
  310. #define MXWH_Signals    MX_TagBase+0x05
  311. #define MXWH_SignalHandler    MX_TagBase+0x06
  312. #define MXWH_Position    MX_TagBase+0x07
  313. #define MXWH_Flags        MX_TagBase+0x08
  314. #define MXWH_WindowSize    MX_TagBase+0x09
  315. #define MXWH_WindowTitle    MX_TagBase+0x0A
  316. #define MXWH_ScreenTitle    MX_TagBase+0x0B
  317. #define MXWH_PositionWindow    MX_TagBase+0x0C
  318. #define MXWH_MenusLocalize    MX_TagBase+0x0D
  319. #define MXWH_InitCode    MX_TagBase+0x10
  320. #define MXWH_IDCMPFlags    MX_TagBase+0x11
  321. #define MXWH_CreateGadTags    MX_TagBase+0x12
  322. #define MXWH_WorkbenchScreen    MX_TagBase+0x13
  323. #define MXWH_TitleCountTo    MX_TagBase+0x14
  324. #define MXWH_NoDrag        MX_TagBase+0x15
  325. #define MXWH_NoDepth    MX_TagBase+0x16
  326. #define MXWH_Centre        MX_TagBase+0x17
  327. #define MXWH_ScreenToFront    MX_TagBase+0x18
  328. #define MXWH_ESCAddress    MX_TagBase+0x19
  329. #define MXWH_ESCvalue    MX_TagBase+0x20
  330. #define MXWH_ListViewKey    MX_TagBase+0x21
  331. #define MXWH_RAWKEYleft    MX_TagBase+0x22
  332. #define MXWH_RAWKEYright    MX_TagBase+0x23
  333. #define MXWH_CloseWindow    MX_TagBase+0x24
  334. #define MXWH_ReturnKeyMode    MX_TagBase+0x25
  335. #define MXWH_ReturnKeyData    MX_TagBase+0x26
  336. #define MXWH_RelativeZeroBase    MX_TagBase+0x27
  337. #define MXWH_FloodRast    MX_TagBase+0x2a
  338. #define MXWH_Borderless    MX_TagBase+0x30
  339. #define MXWH_LastStringUp    MX_TagBase+0x31
  340. #define MXWH_LastStringUpData    MX_TagBase+0x32
  341. #define MXWH_SetWindowHook    MX_TagBase+0x33
  342. #define MXWH_GetWindowHook    MX_TagBase+0x34
  343. #define MXWH_UserData    MX_TagBase+0x35
  344. #define MXWH_WindowPointer    MX_TagBase+0x36
  345. #define MXWH_PreCloseCall    MX_TagBase+0x37
  346. #define MXWH_UseParentPort    MX_TagBase+0x38
  347. #define MXWH_CloseWindowHook    MX_TagBase+0x39
  348. #define MXWH_CustomData    MX_TagBase+0x40
  349. #define MXWH_CustomDataSize    MX_TagBase+0x41
  350. #define MXWH_CustomDataDefault MX_TagBase+0x4
  351. #define MXWH_ZoomGadget    MX_TagBase+0x43
  352. #define MXWH_VisualInfo    MX_TagBase+0x48
  353. #define MXWH_ASLInfo    MX_TagBase+0x50
  354. #define MXWH_ASLFont    MX_TagBase+0x51
  355. #define MXWH_BackupMem    MX_TagBase+0x52
  356. #define MXWH_RemakeWindowHook    MX_TagBase+0x53
  357. #define MXWH_DataPtr    MX_TagBase+0x54
  358. #define MXWH_CatCompArray    MX_TagBase+0x5A
  359. #define MXWH_Locale        MX_TagBase+0x5B
  360. #define MXWH_Catalog    MX_TagBase+0x5C
  361. #define MXWH_LocaleName    MX_TagBase+0x5D
  362. #define MXWH_CatalogName    MX_TagBase+0x5E
  363. #define MXWH_WindowTitleMSGID    MX_TagBase+0x5F                
  364. #define MXWH_Font        MX_TagBase+0x60
  365. #define MXWH_WHStore    MX_TagBase+0x62
  366. #define MXWH_WindowHandlerStore MXWH_WHStore
  367. #define RETMODE_NONE    0x00000000
  368. #define RETMODE_RETURNVAL    0x80000001
  369. #define RETMODE_QUITREVERT    0x80000002
  370. #define RETMODE_HOOK    0x80000003
  371. #define RETMODE_LIST    0x80000004
  372.  
  373. #define LOADFIB_LOCK    0
  374. #define LOADFIB_FILEHANDLE    1
  375. #define LOADFIB_NAME    2
  376.  
  377.  
  378. struct MxIffHunk {
  379.     ULONG    Name;
  380.     ULONG    Type;
  381.     ULONG    Data1;
  382.     ULONG    Data2;
  383. };
  384.  
  385. struct MxBoxC {
  386.     struct Node Node;
  387.     APTR    Hook;
  388.     WORD    X;
  389.     WORD    Y;
  390.     WORD    W;
  391.     WORD    H;
  392.     struct TagItem *Tags;
  393.     ULONG    res;
  394. };
  395.  
  396.  
  397.  
  398. /*****************************************************************************/
  399. /* CONSTANTS for LISTVIEW Gadget */
  400.  
  401. /* The callback hooks used here are not implemented very well. They will be
  402.    replacted by V25 matrix.library with proper struct Hook * hooks. */
  403.  
  404. #define MXLV_GadtoolsTags         MX_TagBase+0x8001
  405. #define MXLV_List                 MX_TagBase+0x8002
  406. #define MXLV_HookSingleClick      MX_TagBase+0x8003
  407. #define MXLV_HookDoubleClick      MX_TagBase+0x8004
  408. #define MXLV_StoreNodeNum         MX_TagBase+0x8005
  409. #define MXLV_StoreNodeAddr        MX_TagBase+0x8006
  410. #define MXLV_StoreNodeText        MX_TagBase+0x8007
  411. #define MXLV_ShowSelected         MX_TagBase+0x8008
  412. #define MXLV_ExitOn2Click         MX_TagBase+0x8009
  413. #define MXLV_Disabled             MX_TagBase+0x800a
  414. #define MXLV_KeyNavigate          MX_TagBase+0x800b
  415. #define MXLV_NewSelectEntry       MX_TagBase+0x800c
  416.  
  417.  
  418.  
  419.  
  420. #define MXNI_Comment    MX_TagBase+0xB001
  421. #define MXNI_Data        MX_TagBase+0xB002
  422. #define MXNI_Error        MX_TagBase+0xB003
  423. #define MXNI_SigTask    MX_TagBase+0xB004
  424. #define MXNI_SigMask    MX_TagBase+0xB005
  425.  
  426. #define MXNI_ERR_OK        0
  427. #define MXNI_ERR_NOMEMORY    1
  428. #define MXNI_ERR_NOTUNIQUE    2
  429.  
  430. struct MxNameInfo {
  431.     struct Node Node;                   /* Standard exec node */
  432.     struct SignalSemaphore Semaphore;   /* Exec semaphore for access arbitration */
  433.     struct Task *SigTask;               /* Task to signal to kill node */
  434.     ULONG SigMask;                      /* Signal mask to kill node */
  435.     STRPTR Comment;                     /* Comment about node, may be NULL */
  436.     APTR Data;                          /* Application specific data field */
  437. };
  438.  
  439.  
  440. /*****************************************************************************/
  441. /* TAGS for MX_SetConfig() */
  442. #define MXCFG_GadgetHeight    MX_TagBase+0xBA01
  443.  
  444. /*****************************************************************************/
  445. /* CONSTANTS for MXCFG_GadgetHeight */
  446. #define MX_GADHEIGHT_NORMAL   0
  447. #define MX_GADHEIGHT_SMALL    1
  448. #define MX_GADHEIGHT_TALL     2
  449.  
  450.  
  451.  
  452.  
  453. /*****************************************************************************/
  454. /* CONSTANTS for MX_LogMsg() */
  455.  
  456. #define MXLOGTASK_UNKNOWN       0
  457. #define MXLOGTASK_APPLICATION   1
  458. #define MXLOGTASK_DAEMON        2
  459.  
  460. #define MXLOGMESG_UNKNOWN       0
  461. #define MXLOGMESG_GENERAL       1
  462.  
  463.  
  464. #endif    /* LIBRARIES_MXBASE_H */
  465.  
  466.  
  467.